﻿{% extends "admin/base_site.html" %}
{% load i18n %}
{% load dummy_extras %}

{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{{ admin_media_prefix }}css/forms.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/aristocles.css" />
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
    <a href="{{ back|default:"" }}../../../">{% trans "Home" %}</a> &rsaquo;
    <a href="{{ back|default:"" }}../../">{{ app_label|appname }}</a> &rsaquo;
    <a href="{{ back|default:"" }}../">{{ model_name }}</a> &rsaquo;
    {{ title }}
</div>
{% endblock %}

{% block content %}
    <div id="content-main">
        <form action="." method="post">{% csrf_token %}
            <div>
                {% if form.errors %}
                    <p class="errornote">Пожалуйста, исправьте ошибку ниже.</p>
                    {{ form.non_field_errors }}
                {% endif %}
                <fieldset class="module aligned">
                    {% for field in form %}
                        {{ field.errors }}
                        <div class="form-row {% if field.errors %}errors{% endif %}">
                            <div>
                                {{ field.label_tag }}
                                {{ field }}
                            </div>
                        </div>
                    {% endfor %}
                </fieldset>
                {% if view %}
                    <div class="results">
                        <table cellspacing="0" id="result_list" width="100%">
                            {% for line in view %}
                                {% if forloop.first %}
                                    <thead>
                                {% endif %}
                                        <tr>
                                            {% for item in line %}
                                                {% if forloop.parentloop.first %}
                                                    <th scope="col">
                                                {% else %}
                                                {% if forloop.first %}
                                                    <th>
                                                {% else %}
                                                    <td align="center">
                                                {% endif %}
                                                {% endif %}
                                                    {% if item.href %}
                                                        <a href="{{ item.href }}">{{ item.name }}</a>
                                                    {% else %}
                                                        {{ item.name }}
                                                    {% endif %}
                                                {% if forloop.parentloop.first or forloop.first %}
                                                    </th>
                                                {% else %}
                                                    </td>
                                                {% endif %}
                                            {% endfor %}
                                        </tr>
                                {% if forloop.first %}
                                    </thead>
                                    <tbody>
                                {% endif %}
                                {% if forloop.last %}
                                    </tbody>
                                {% endif %}
                            {% endfor %}
                        </table>
                    </div>
                {% endif %}
                <div>
                    <input type="submit" value="Просмотр результатов" class="default" name="result"/>
                </div>
            </div>
        </form>
    </div>
{% endblock %}
